#{extends 'overlay.html' /}
<div id="crudBlank" class="${type.name}">
	<h2 id="crudBlankTitle">&{'crud.blank.title', type.modelName}</h2>
	<div class="objectForm">
	#{form action:@create(project?.id), enctype:'multipart/form-data'}
		<div class="crudField">
		<a href="javascript:check_all_perms(true);">Check all</a>, <a href="javascript:check_all_perms(false);">uncheck all</a> <!-- or
		import permissions from: <select id="inherit" onchange="import_permissions($('#inherit :selected').val());"><option value=0></option>
			#{list project ? project.roles : roles}
				<option value="${_.id}">${_.name}</option>
			#{/list}
		</select> --> <img id="loading" style="display:none;" src="/public/images/ajax-loader.gif" />
		</div>
		#{crud.form fields:['name', 'permissions'] /}
		<input type="hidden" name="object.project@id" value="${project?.id ?: 0}" />
		<p class="crudButtons">
			<input type="submit" name="_save" value="&{'crud.save', type.modelName}" />
			<input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', type.modelName}" />
			<input type="submit" name="_saveAndAddAnother" value="&{'crud.saveAndAddAnother', type.modelName}" />
		</p>
	#{/form}
	</div>
</div>